package org.leaf.green.b2b

class MarketPriceActualDetail {

    MarketPriceActual marketPriceActual         //
    String serialNumber                         //行号
    String product                              //产品名称
    
    BigDecimal regionPrice                      //区域基准价格

    static belongsTo = [marketPriceActual : MarketPriceActual]
    static hasMany = [details : MarketPriceActualDetailDetail]

    static constraints = {
        marketPriceActual(nullable:false)
        serialNumber(nullable:false, blank:false, maxSize : 3, unique : 'marketPriceActual')
        product(nullable:false, blank:false,maxSize:60)
        regionPrice(nullable:false, scale : 2)
   }

    String toString(){
        return "${serialNumber}"
    }

    static mapping = {
        table 'B2B_MARKET_PRICE_ACTUAL_DETAIL'
        details cascade:"all-delete-orphan", sort:"serialNumber", batchSize: 100
    }

}
